﻿Imports Microsoft.VisualBasic
Imports System.Net.Mail

Public Class clsMail
    Public Shared Sub Send(ByVal userID As String, ByVal message As MailMessage)
        clsMail.Send(New String() {userID}, message)
    End Sub

    Public Shared Sub Send(ByVal userList() As String, ByVal message As MailMessage)
        For Each userID As String In userList
            message.To.Add(clsUser.GetUserAddress(userID))
        Next

        message.From = New MailAddress(MyObj.GetParameter("Mail", "DefaultSender"))

        Dim smtp As New SmtpClient
        smtp.Send(message)
    End Sub

End Class
